.class public Lorg/zeam/CellLayout;
.super Landroid/view/ViewGroup;
.source "CellLayout.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lorg/zeam/CellLayout$CellInfo;,
        Lorg/zeam/CellLayout$LayoutParams;
    }
.end annotation


# instance fields
.field private mCellHeight:I

.field private final mCellInfo:Lorg/zeam/CellLayout$CellInfo;

.field private mCellWidth:I

.field mCellXY:[I

.field private mColumns:I

.field private mDirtyTag:Z

.field private mDragRect:Landroid/graphics/RectF;

.field private mHeightGap:I

.field private mLastDownOnOccupiedCell:Z

.field private mLongAxisCells:I

.field private mLongAxisEndPadding:I

.field private mLongAxisStartPadding:I

.field mOccupied:[[Z

.field private mPortrait:Z

.field private final mRect:Landroid/graphics/Rect;

.field private mRows:I

.field private mShortAxisCells:I

.field private mShortAxisEndPadding:I

.field private mShortAxisStartPadding:I

.field private final mWallpaperManager:Landroid/app/WallpaperManager;

.field private mWidthGap:I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "context"

    .prologue
    .line 65
    const/4 v0, 0x0

    invoke-direct {p0, p1, v0}, Lorg/zeam/CellLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 66
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 69
    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lorg/zeam/CellLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 70
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 5
    .parameter "context"
    .parameter "attrs"
    .parameter "defStyle"

    .prologue
    const/4 v4, 0x2

    const/4 v3, 0x0

    const/16 v2, 0xa

    .line 74
    invoke-direct {p0, p1, p2, p3}, Landroid/view/ViewGroup;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 50
    new-instance v1, Landroid/graphics/Rect;

    invoke-direct {v1}, Landroid/graphics/Rect;-><init>()V

    iput-object v1, p0, Lorg/zeam/CellLayout;->mRect:Landroid/graphics/Rect;

    .line 51
    new-instance v1, Lorg/zeam/CellLayout$CellInfo;

    invoke-direct {v1}, Lorg/zeam/CellLayout$CellInfo;-><init>()V

    iput-object v1, p0, Lorg/zeam/CellLayout;->mCellInfo:Lorg/zeam/CellLayout$CellInfo;

    .line 52
    new-array v1, v4, [I

    iput-object v1, p0, Lorg/zeam/CellLayout;->mCellXY:[I

    .line 55
    new-instance v1, Landroid/graphics/RectF;

    invoke-direct {v1}, Landroid/graphics/RectF;-><init>()V

    iput-object v1, p0, Lorg/zeam/CellLayout;->mDragRect:Landroid/graphics/RectF;

    .line 58
    iput-boolean v3, p0, Lorg/zeam/CellLayout;->mLastDownOnOccupiedCell:Z

    .line 75
    sget-object v1, Lorg/zeam/R$styleable;->CellLayout:[I

    invoke-virtual {p1, p2, v1, p3, v3}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;

    move-result-object v0

    .line 77
    .local v0, typedArray:Landroid/content/res/TypedArray;
    invoke-virtual {v0, v3, v2}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v1

    iput v1, p0, Lorg/zeam/CellLayout;->mCellWidth:I

    .line 78
    const/4 v1, 0x1

    invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v1

    iput v1, p0, Lorg/zeam/CellLayout;->mCellHeight:I

    .line 79
    invoke-virtual {v0, v4, v2}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v1

    iput v1, p0, Lorg/zeam/CellLayout;->mLongAxisStartPadding:I

    .line 80
    const/4 v1, 0x3

    invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v1

    iput v1, p0, Lorg/zeam/CellLayout;->mLongAxisEndPadding:I

    .line 81
    const/4 v1, 0x4

    invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v1

    iput v1, p0, Lorg/zeam/CellLayout;->mShortAxisStartPadding:I

    .line 82
    const/4 v1, 0x5

    invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getDimensionPixelSize(II)I

    move-result v1

    iput v1, p0, Lorg/zeam/CellLayout;->mShortAxisEndPadding:I

    .line 84
    invoke-virtual {p0}, Lorg/zeam/CellLayout;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Lorg/zeam/PreferencesUtil;->getContentGridRows(Landroid/content/Context;)I

    move-result v1

    iput v1, p0, Lorg/zeam/CellLayout;->mRows:I

    .line 85
    invoke-virtual {p0}, Lorg/zeam/CellLayout;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Lorg/zeam/PreferencesUtil;->getContentGridColumns(Landroid/content/Context;)I

    move-result v1

    iput v1, p0, Lorg/zeam/CellLayout;->mColumns:I

    .line 87
    invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V

    .line 88
    invoke-virtual {p0, v3}, Lorg/zeam/CellLayout;->setAlwaysDrawnWithCacheEnabled(Z)V

    .line 96
    invoke-virtual {p0}, Lorg/zeam/CellLayout;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Landroid/app/WallpaperManager;->getInstance(Landroid/content/Context;)Landroid/app/WallpaperManager;

    move-result-object v1

    iput-object v1, p0, Lorg/zeam/CellLayout;->mWallpaperManager:Landroid/app/WallpaperManager;

    .line 97
    return-void
.end method

.method static synthetic access$1(Lorg/zeam/CellLayout$CellInfo;IIII[[Z)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 237
    invoke-static/range {p0 .. p5}, Lorg/zeam/CellLayout;->findIntersectingVacantCells(Lorg/zeam/CellLayout$CellInfo;IIII[[Z)V

    return-void
.end method

.method private static addVacantCell(Landroid/graphics/Rect;Lorg/zeam/CellLayout$CellInfo;)V
    .locals 3
    .parameter "current"
    .parameter "cellInfo"

    .prologue
    .line 317
    invoke-static {}, Lorg/zeam/CellLayout$CellInfo$VacantCell;->acquire()Lorg/zeam/CellLayout$CellInfo$VacantCell;

    move-result-object v0

    .line 318
    .local v0, cell:Lorg/zeam/CellLayout$CellInfo$VacantCell;
    iget v1, p0, Landroid/graphics/Rect;->left:I

    iput v1, v0, Lorg/zeam/CellLayout$CellInfo$VacantCell;->cellX:I

    .line 319
    iget v1, p0, Landroid/graphics/Rect;->top:I

    iput v1, v0, Lorg/zeam/CellLayout$CellInfo$VacantCell;->cellY:I

    .line 320
    iget v1, p0, Landroid/graphics/Rect;->right:I

    iget v2, p0, Landroid/graphics/Rect;->left:I

    sub-int/2addr v1, v2

    add-int/lit8 v1, v1, 0x1

    iput v1, v0, Lorg/zeam/CellLayout$CellInfo$VacantCell;->spanX:I

    .line 321
    iget v1, p0, Landroid/graphics/Rect;->bottom:I

    iget v2, p0, Landroid/graphics/Rect;->top:I

    sub-int/2addr v1, v2

    add-int/lit8 v1, v1, 0x1

    iput v1, v0, Lorg/zeam/CellLayout$CellInfo$VacantCell;->spanY:I

    .line 322
    iget v1, v0, Lorg/zeam/CellLayout$CellInfo$VacantCell;->spanX:I

    iget v2, p1, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanX:I

    if-le v1, v2, :cond_0

    .line 323
    iget v1, v0, Lorg/zeam/CellLayout$CellInfo$VacantCell;->spanX:I

    iput v1, p1, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanX:I

    .line 324
    iget v1, v0, Lorg/zeam/CellLayout$CellInfo$VacantCell;->spanY:I

    iput v1, p1, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanXSpanY:I

    .line 326
    :cond_0
    iget v1, v0, Lorg/zeam/CellLayout$CellInfo$VacantCell;->spanY:I

    iget v2, p1, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanY:I

    if-le v1, v2, :cond_1

    .line 327
    iget v1, v0, Lorg/zeam/CellLayout$CellInfo$VacantCell;->spanY:I

    iput v1, p1, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanY:I

    .line 328
    iget v1, v0, Lorg/zeam/CellLayout$CellInfo$VacantCell;->spanX:I

    iput v1, p1, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanYSpanX:I

    .line 330
    :cond_1
    iget-object v1, p1, Lorg/zeam/CellLayout$CellInfo;->vacantCells:Ljava/util/ArrayList;

    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 331
    return-void
.end method

.method private static findIntersectingVacantCells(Lorg/zeam/CellLayout$CellInfo;IIII[[Z)V
    .locals 2
    .parameter "cellInfo"
    .parameter "x"
    .parameter "y"
    .parameter "xCount"
    .parameter "yCount"
    .parameter "occupied"

    .prologue
    const/high16 v1, -0x8000

    .line 243
    iput v1, p0, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanX:I

    .line 244
    iput v1, p0, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanXSpanY:I

    .line 245
    iput v1, p0, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanY:I

    .line 246
    iput v1, p0, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanYSpanX:I

    .line 247
    invoke-virtual {p0}, Lorg/zeam/CellLayout$CellInfo;->clearVacantCells()V

    .line 250
    :try_start_0
    aget-object v1, p5, p1

    aget-boolean v1, v1, p2
    :try_end_0
    .catch Ljava/lang/IndexOutOfBoundsException; {:try_start_0 .. :try_end_0} :catch_0

    if-eqz v1, :cond_0

    .line 258
    :goto_0
    return-void

    .line 253
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 254
    .local v0, e:Ljava/lang/IndexOutOfBoundsException;
    goto :goto_0

    .line 256
    .end local v0           #e:Ljava/lang/IndexOutOfBoundsException;
    :cond_0
    iget-object v1, p0, Lorg/zeam/CellLayout$CellInfo;->current:Landroid/graphics/Rect;

    invoke-virtual {v1, p1, p2, p1, p2}, Landroid/graphics/Rect;->set(IIII)V

    .line 257
    iget-object v1, p0, Lorg/zeam/CellLayout$CellInfo;->current:Landroid/graphics/Rect;

    invoke-static {v1, p3, p4, p5, p0}, Lorg/zeam/CellLayout;->findVacantCell(Landroid/graphics/Rect;II[[ZLorg/zeam/CellLayout$CellInfo;)V

    goto :goto_0
.end method

.method private findOccupiedCells(II[[ZLandroid/view/View;)V
    .locals 9
    .parameter "xCount"
    .parameter "yCount"
    .parameter "occupied"
    .parameter "ignoreView"

    .prologue
    const/4 v8, -0x1

    .line 727
    const/4 v4, 0x0

    .local v4, x:I
    :goto_0
    if-lt v4, p1, :cond_0

    .line 732
    invoke-virtual {p0}, Lorg/zeam/CellLayout;->getChildCount()I

    move-result v1

    .line 733
    .local v1, count:I
    const/4 v2, 0x0

    .local v2, i:I
    :goto_1
    if-lt v2, v1, :cond_2

    .line 747
    return-void

    .line 728
    .end local v1           #count:I
    .end local v2           #i:I
    :cond_0
    const/4 v5, 0x0

    .local v5, y:I
    :goto_2
    if-lt v5, p2, :cond_1

    .line 727
    add-int/lit8 v4, v4, 0x1

    goto :goto_0

    .line 729
    :cond_1
    aget-object v6, p3, v4

    const/4 v7, 0x0

    aput-boolean v7, v6, v5

    .line 728
    add-int/lit8 v5, v5, 0x1

    goto :goto_2

    .line 734
    .end local v5           #y:I
    .restart local v1       #count:I
    .restart local v2       #i:I
    :cond_2
    invoke-virtual {p0, v2}, Lorg/zeam/CellLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    .line 735
    .local v0, child:Landroid/view/View;
    instance-of v6, v0, Lorg/zeam/Folder;

    if-nez v6, :cond_3

    invoke-virtual {v0, p4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_4

    .line 733
    :cond_3
    add-int/lit8 v2, v2, 0x1

    goto :goto_1

    .line 738
    :cond_4
    invoke-virtual {v0}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v3

    check-cast v3, Lorg/zeam/CellLayout$LayoutParams;

    .line 739
    .local v3, layoutParams:Lorg/zeam/CellLayout$LayoutParams;
    iget v4, v3, Lorg/zeam/CellLayout$LayoutParams;->cellX:I

    :goto_3
    iget v6, v3, Lorg/zeam/CellLayout$LayoutParams;->cellX:I

    iget v7, v3, Lorg/zeam/CellLayout$LayoutParams;->cellHSpan:I

    add-int/2addr v6, v7

    if-ge v4, v6, :cond_3

    if-ge v4, p1, :cond_3

    .line 740
    iget v5, v3, Lorg/zeam/CellLayout$LayoutParams;->cellY:I

    .restart local v5       #y:I
    :goto_4
    iget v6, v3, Lorg/zeam/CellLayout$LayoutParams;->cellY:I

    iget v7, v3, Lorg/zeam/CellLayout$LayoutParams;->cellVSpan:I

    add-int/2addr v6, v7

    if-ge v5, v6, :cond_5

    if-lt v5, p2, :cond_6

    .line 739
    :cond_5
    add-int/lit8 v4, v4, 0x1

    goto :goto_3

    .line 741
    :cond_6
    if-eq v4, v8, :cond_7

    if-eq v5, v8, :cond_7

    .line 742
    aget-object v6, p3, v4

    const/4 v7, 0x1

    aput-boolean v7, v6, v5

    .line 740
    :cond_7
    add-int/lit8 v5, v5, 0x1

    goto :goto_4
.end method

.method private static findVacantCell(Landroid/graphics/Rect;II[[ZLorg/zeam/CellLayout$CellInfo;)V
    .locals 5
    .parameter "current"
    .parameter "xCount"
    .parameter "yCount"
    .parameter "occupied"
    .parameter "cellInfo"

    .prologue
    .line 292
    const/4 v1, 0x0

    .local v1, l:I
    :goto_0
    if-lt v1, p1, :cond_0

    .line 303
    return-void

    .line 293
    :cond_0
    move v2, v1

    .local v2, r:I
    :goto_1
    if-lt v2, p1, :cond_1

    .line 292
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 294
    :cond_1
    const/4 v3, 0x0

    .local v3, t:I
    :goto_2
    if-lt v3, p2, :cond_2

    .line 293
    add-int/lit8 v2, v2, 0x1

    goto :goto_1

    .line 295
    :cond_2
    move v0, v3

    .local v0, b:I
    :goto_3
    if-ge v0, p2, :cond_3

    invoke-static {v0, v1, v2, p3}, Lorg/zeam/CellLayout;->isRowEmpty(III[[Z)Z

    move-result v4

    if-nez v4, :cond_4

    .line 294
    :cond_3
    add-int/lit8 v3, v3, 0x1

    goto :goto_2

    .line 297
    :cond_4
    iput v1, p0, Landroid/graphics/Rect;->left:I

    .line 298
    iput v2, p0, Landroid/graphics/Rect;->right:I

    .line 299
    iput v3, p0, Landroid/graphics/Rect;->top:I

    .line 300
    iput v0, p0, Landroid/graphics/Rect;->bottom:I

    .line 301
    invoke-static {p0, p4}, Lorg/zeam/CellLayout;->addVacantCell(Landroid/graphics/Rect;Lorg/zeam/CellLayout$CellInfo;)V

    .line 295
    add-int/lit8 v0, v0, 0x1

    goto :goto_3
.end method

.method static findVacantCell([IIIII[[Z)Z
    .locals 8
    .parameter "vacant"
    .parameter "spanX"
    .parameter "spanY"
    .parameter "xCount"
    .parameter "yCount"
    .parameter "occupied"

    .prologue
    const/4 v7, 0x0

    const/4 v6, 0x1

    .line 688
    const/4 v3, 0x0

    .local v3, x:I
    :goto_0
    if-lt v3, p3, :cond_0

    move v5, v7

    .line 705
    :goto_1
    return v5

    .line 689
    :cond_0
    const/4 v4, 0x0

    .local v4, y:I
    :goto_2
    if-lt v4, p4, :cond_1

    .line 688
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .line 690
    :cond_1
    aget-object v5, p5, v3

    aget-boolean v5, v5, v4

    if-eqz v5, :cond_3

    move v0, v7

    .line 691
    .local v0, available:Z
    :goto_3
    move v1, v3

    .local v1, i:I
    :goto_4
    add-int v5, v3, p1

    sub-int/2addr v5, v6

    if-ge v1, v5, :cond_2

    if-lt v3, p3, :cond_4

    .line 698
    :cond_2
    if-eqz v0, :cond_8

    .line 699
    aput v3, p0, v7

    .line 700
    aput v4, p0, v6

    move v5, v6

    .line 701
    goto :goto_1

    .end local v0           #available:Z
    .end local v1           #i:I
    :cond_3
    move v0, v6

    .line 690
    goto :goto_3

    .line 692
    .restart local v0       #available:Z
    .restart local v1       #i:I
    :cond_4
    move v2, v4

    .local v2, j:I
    :goto_5
    add-int v5, v4, p2

    sub-int/2addr v5, v6

    if-ge v2, v5, :cond_5

    if-lt v4, p4, :cond_6

    .line 691
    :cond_5
    add-int/lit8 v1, v1, 0x1

    goto :goto_4

    .line 693
    :cond_6
    if-eqz v0, :cond_7

    aget-object v5, p5, v1

    aget-boolean v5, v5, v2

    if-nez v5, :cond_7

    move v0, v6

    .line 694
    :goto_6
    if-eqz v0, :cond_2

    .line 692
    add-int/lit8 v2, v2, 0x1

    goto :goto_5

    :cond_7
    move v0, v7

    .line 693
    goto :goto_6

    .line 689
    .end local v2           #j:I
    :cond_8
    add-int/lit8 v4, v4, 0x1

    goto :goto_2
.end method

.method public static isEmpty(IIII[[Z)Z
    .locals 3
    .parameter "x0"
    .parameter "x1"
    .parameter "y0"
    .parameter "y1"
    .parameter "occupied"

    .prologue
    .line 307
    move v0, p0

    .local v0, x:I
    :goto_0
    if-le v0, p1, :cond_0

    .line 312
    const/4 v2, 0x1

    :goto_1
    return v2

    .line 308
    :cond_0
    move v1, p2

    .local v1, y:I
    :goto_2
    if-le v1, p3, :cond_1

    .line 307
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 309
    :cond_1
    aget-object v2, p4, v0

    aget-boolean v2, v2, v1

    if-eqz v2, :cond_2

    .line 310
    const/4 v2, 0x0

    goto :goto_1

    .line 308
    :cond_2
    add-int/lit8 v1, v1, 0x1

    goto :goto_2
.end method

.method private static isRowEmpty(III[[Z)Z
    .locals 2
    .parameter "y"
    .parameter "left"
    .parameter "right"
    .parameter "occupied"

    .prologue
    .line 345
    move v0, p1

    .local v0, x:I
    :goto_0
    if-le v0, p2, :cond_0

    .line 350
    const/4 v1, 0x1

    :goto_1
    return v1

    .line 346
    :cond_0
    aget-object v1, p3, v0

    aget-boolean v1, v1, p0

    if-eqz v1, :cond_1

    .line 347
    const/4 v1, 0x0

    goto :goto_1

    .line 345
    :cond_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method


# virtual methods
.method public addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V
    .locals 3
    .parameter "child"
    .parameter "index"
    .parameter "params"

    .prologue
    .line 126
    move-object v0, p3

    check-cast v0, Lorg/zeam/CellLayout$LayoutParams;

    move-object v1, v0

    .line 127
    .local v1, cellParams:Lorg/zeam/CellLayout$LayoutParams;
    const/4 v2, 0x1

    iput-boolean v2, v1, Lorg/zeam/CellLayout$LayoutParams;->regenerateId:Z

    .line 128
    invoke-super {p0, p1, p2, p3}, Landroid/view/ViewGroup;->addView(Landroid/view/View;ILandroid/view/ViewGroup$LayoutParams;)V

    .line 129
    return-void
.end method

.method public cancelLongPress()V
    .locals 3

    .prologue
    .line 102
    invoke-super {p0}, Landroid/view/ViewGroup;->cancelLongPress()V

    .line 103
    invoke-virtual {p0}, Lorg/zeam/CellLayout;->getChildCount()I

    move-result v1

    .line 104
    .local v1, count:I
    const/4 v2, 0x0

    .local v2, i:I
    :goto_0
    if-lt v2, v1, :cond_0

    .line 108
    return-void

    .line 105
    :cond_0
    invoke-virtual {p0, v2}, Lorg/zeam/CellLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    .line 106
    .local v0, child:Landroid/view/View;
    invoke-virtual {v0}, Landroid/view/View;->cancelLongPress()V

    .line 104
    add-int/lit8 v2, v2, 0x1

    goto :goto_0
.end method

.method cellToPoint(II[I)V
    .locals 6
    .parameter "cellX"
    .parameter "cellY"
    .parameter "result"

    .prologue
    .line 432
    iget-boolean v1, p0, Lorg/zeam/CellLayout;->mPortrait:Z

    .line 433
    .local v1, portrait:Z
    if-eqz v1, :cond_0

    iget v3, p0, Lorg/zeam/CellLayout;->mShortAxisStartPadding:I

    move v0, v3

    .line 434
    .local v0, hStartPadding:I
    :goto_0
    if-eqz v1, :cond_1

    iget v3, p0, Lorg/zeam/CellLayout;->mLongAxisStartPadding:I

    move v2, v3

    .line 435
    .local v2, vStartPadding:I
    :goto_1
    const/4 v3, 0x0

    iget v4, p0, Lorg/zeam/CellLayout;->mCellWidth:I

    iget v5, p0, Lorg/zeam/CellLayout;->mWidthGap:I

    add-int/2addr v4, v5

    mul-int/2addr v4, p1

    add-int/2addr v4, v0

    aput v4, p3, v3

    .line 436
    const/4 v3, 0x1

    iget v4, p0, Lorg/zeam/CellLayout;->mCellHeight:I

    iget v5, p0, Lorg/zeam/CellLayout;->mHeightGap:I

    add-int/2addr v4, v5

    mul-int/2addr v4, p2

    add-int/2addr v4, v2

    aput v4, p3, v3

    .line 437
    return-void

    .line 433
    .end local v0           #hStartPadding:I
    .end local v2           #vStartPadding:I
    :cond_0
    iget v3, p0, Lorg/zeam/CellLayout;->mLongAxisStartPadding:I

    move v0, v3

    goto :goto_0

    .line 434
    .restart local v0       #hStartPadding:I
    :cond_1
    iget v3, p0, Lorg/zeam/CellLayout;->mShortAxisStartPadding:I

    move v2, v3

    goto :goto_1
.end method

.method protected checkLayoutParams(Landroid/view/ViewGroup$LayoutParams;)Z
    .locals 1
    .parameter "layoutParams"

    .prologue
    .line 760
    instance-of v0, p1, Lorg/zeam/CellLayout$LayoutParams;

    return v0
.end method

.method protected dispatchDraw(Landroid/graphics/Canvas;)V
    .locals 0
    .parameter "canvas"

    .prologue
    .line 120
    invoke-super {p0, p1}, Landroid/view/ViewGroup;->dispatchDraw(Landroid/graphics/Canvas;)V

    .line 121
    return-void
.end method

.method findAllVacantCells([ZLandroid/view/View;)Lorg/zeam/CellLayout$CellInfo;
    .locals 8
    .parameter "occupiedCells"
    .parameter "ignoreView"

    .prologue
    .line 355
    iget-boolean v1, p0, Lorg/zeam/CellLayout;->mPortrait:Z

    .line 356
    .local v1, portrait:Z
    if-eqz v1, :cond_0

    iget v6, p0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move v3, v6

    .line 357
    .local v3, xCount:I
    :goto_0
    if-eqz v1, :cond_1

    iget v6, p0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move v5, v6

    .line 358
    .local v5, yCount:I
    :goto_1
    iget-object v0, p0, Lorg/zeam/CellLayout;->mOccupied:[[Z

    .line 360
    .local v0, occupied:[[Z
    if-eqz p1, :cond_4

    .line 361
    const/4 v4, 0x0

    .local v4, y:I
    :goto_2
    if-lt v4, v5, :cond_2

    .line 369
    .end local v4           #y:I
    :goto_3
    invoke-virtual {p0, v0, v3, v5}, Lorg/zeam/CellLayout;->findAllVacantCellsFromOccupied([[ZII)Lorg/zeam/CellLayout$CellInfo;

    move-result-object v6

    return-object v6

    .line 356
    .end local v0           #occupied:[[Z
    .end local v3           #xCount:I
    .end local v5           #yCount:I
    :cond_0
    iget v6, p0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move v3, v6

    goto :goto_0

    .line 357
    .restart local v3       #xCount:I
    :cond_1
    iget v6, p0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move v5, v6

    goto :goto_1

    .line 362
    .restart local v0       #occupied:[[Z
    .restart local v4       #y:I
    .restart local v5       #yCount:I
    :cond_2
    const/4 v2, 0x0

    .local v2, x:I
    :goto_4
    if-lt v2, v3, :cond_3

    .line 361
    add-int/lit8 v4, v4, 0x1

    goto :goto_2

    .line 363
    :cond_3
    aget-object v6, v0, v2

    mul-int v7, v4, v3

    add-int/2addr v7, v2

    aget-boolean v7, p1, v7

    aput-boolean v7, v6, v4

    .line 362
    add-int/lit8 v2, v2, 0x1

    goto :goto_4

    .line 367
    .end local v2           #x:I
    .end local v4           #y:I
    :cond_4
    invoke-direct {p0, v3, v5, v0, p2}, Lorg/zeam/CellLayout;->findOccupiedCells(II[[ZLandroid/view/View;)V

    goto :goto_3
.end method

.method findAllVacantCellsFromOccupied([[ZII)Lorg/zeam/CellLayout$CellInfo;
    .locals 5
    .parameter "occupied"
    .parameter "xCount"
    .parameter "yCount"

    .prologue
    const/4 v4, -0x1

    const/4 v3, 0x0

    const/high16 v2, -0x8000

    .line 374
    new-instance v0, Lorg/zeam/CellLayout$CellInfo;

    invoke-direct {v0}, Lorg/zeam/CellLayout$CellInfo;-><init>()V

    .line 376
    .local v0, cellInfo:Lorg/zeam/CellLayout$CellInfo;
    iput v4, v0, Lorg/zeam/CellLayout$CellInfo;->cellX:I

    .line 377
    iput v4, v0, Lorg/zeam/CellLayout$CellInfo;->cellY:I

    .line 378
    iput v3, v0, Lorg/zeam/CellLayout$CellInfo;->spanY:I

    .line 379
    iput v3, v0, Lorg/zeam/CellLayout$CellInfo;->spanX:I

    .line 380
    iput v2, v0, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanX:I

    .line 381
    iput v2, v0, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanXSpanY:I

    .line 382
    iput v2, v0, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanY:I

    .line 383
    iput v2, v0, Lorg/zeam/CellLayout$CellInfo;->maxVacantSpanYSpanX:I

    .line 384
    iget-object v2, p0, Lorg/zeam/CellLayout;->mCellInfo:Lorg/zeam/CellLayout$CellInfo;

    iget v2, v2, Lorg/zeam/CellLayout$CellInfo;->screen:I

    iput v2, v0, Lorg/zeam/CellLayout$CellInfo;->screen:I

    .line 386
    iget-object v1, v0, Lorg/zeam/CellLayout$CellInfo;->current:Landroid/graphics/Rect;

    .line 399
    .local v1, current:Landroid/graphics/Rect;
    invoke-static {v1, p2, p3, p1, v0}, Lorg/zeam/CellLayout;->findVacantCell(Landroid/graphics/Rect;II[[ZLorg/zeam/CellLayout$CellInfo;)V

    .line 400
    iget-object v2, v0, Lorg/zeam/CellLayout$CellInfo;->vacantCells:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

    if-lez v2, :cond_0

    const/4 v2, 0x1

    :goto_0
    iput-boolean v2, v0, Lorg/zeam/CellLayout$CellInfo;->valid:Z

    .line 401
    return-object v0

    :cond_0
    move v2, v3

    .line 400
    goto :goto_0
.end method

.method findNearestVacantArea(IIIILorg/zeam/CellLayout$CellInfo;[I)[I
    .locals 19
    .parameter "pixelX"
    .parameter "pixelY"
    .parameter "spanX"
    .parameter "spanY"
    .parameter "vacantCells"
    .parameter "recycle"

    .prologue
    .line 602
    if-eqz p6, :cond_0

    move-object/from16 v6, p6

    .line 603
    .local v6, bestXY:[I
    :goto_0
    move-object/from16 v0, p0

    iget-object v0, v0, Lorg/zeam/CellLayout;->mCellXY:[I

    move-object v8, v0

    .line 604
    .local v8, cellXY:[I
    const-wide v4, 0x7fefffffffffffffL

    .line 606
    .local v4, bestDistance:D
    move-object/from16 v0, p5

    iget-boolean v0, v0, Lorg/zeam/CellLayout$CellInfo;->valid:Z

    move v13, v0

    if-nez v13, :cond_1

    .line 607
    const/4 v13, 0x0

    .line 628
    :goto_1
    return-object v13

    .line 602
    .end local v4           #bestDistance:D
    .end local v6           #bestXY:[I
    .end local v8           #cellXY:[I
    :cond_0
    const/4 v13, 0x2

    new-array v13, v13, [I

    move-object v6, v13

    goto :goto_0

    .line 609
    .restart local v4       #bestDistance:D
    .restart local v6       #bestXY:[I
    .restart local v8       #cellXY:[I
    :cond_1
    move-object/from16 v0, p5

    iget-object v0, v0, Lorg/zeam/CellLayout$CellInfo;->vacantCells:Ljava/util/ArrayList;

    move-object v13, v0

    invoke-virtual {v13}, Ljava/util/ArrayList;->size()I

    move-result v12

    .line 610
    .local v12, size:I
    const/4 v11, 0x0

    .local v11, i:I
    :goto_2
    if-lt v11, v12, :cond_2

    .line 625
    const-wide v13, 0x7fefffffffffffffL

    cmpg-double v13, v4, v13

    if-gez v13, :cond_5

    move-object v13, v6

    .line 626
    goto :goto_1

    .line 612
    :cond_2
    move-object/from16 v0, p5

    iget-object v0, v0, Lorg/zeam/CellLayout$CellInfo;->vacantCells:Ljava/util/ArrayList;

    move-object v13, v0

    invoke-virtual {v13, v11}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Lorg/zeam/CellLayout$CellInfo$VacantCell;

    .line 613
    .local v7, cell:Lorg/zeam/CellLayout$CellInfo$VacantCell;
    iget v13, v7, Lorg/zeam/CellLayout$CellInfo$VacantCell;->spanX:I

    move v0, v13

    move/from16 v1, p3

    if-ne v0, v1, :cond_3

    iget v13, v7, Lorg/zeam/CellLayout$CellInfo$VacantCell;->spanY:I

    move v0, v13

    move/from16 v1, p4

    if-eq v0, v1, :cond_4

    .line 610
    :cond_3
    :goto_3
    add-int/lit8 v11, v11, 0x1

    goto :goto_2

    .line 616
    :cond_4
    iget v13, v7, Lorg/zeam/CellLayout$CellInfo$VacantCell;->cellX:I

    iget v14, v7, Lorg/zeam/CellLayout$CellInfo$VacantCell;->cellY:I

    move-object/from16 v0, p0

    move v1, v13

    move v2, v14

    move-object v3, v8

    invoke-virtual {v0, v1, v2, v3}, Lorg/zeam/CellLayout;->cellToPoint(II[I)V

    .line 617
    const/4 v13, 0x0

    aget v13, v8, v13

    sub-int v13, v13, p1

    int-to-double v13, v13

    const-wide/high16 v15, 0x4000

    invoke-static/range {v13 .. v16}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v13

    const/4 v15, 0x1

    aget v15, v8, v15

    sub-int v15, v15, p2

    int-to-double v15, v15

    const-wide/high16 v17, 0x4000

    invoke-static/range {v15 .. v18}, Ljava/lang/Math;->pow(DD)D

    move-result-wide v15

    add-double/2addr v13, v15

    invoke-static {v13, v14}, Ljava/lang/Math;->sqrt(D)D

    move-result-wide v9

    .line 619
    .local v9, distance:D
    cmpg-double v13, v9, v4

    if-gtz v13, :cond_3

    .line 620
    move-wide v4, v9

    .line 621
    const/4 v13, 0x0

    iget v14, v7, Lorg/zeam/CellLayout$CellInfo$VacantCell;->cellX:I

    aput v14, v6, v13

    .line 622
    const/4 v13, 0x1

    iget v14, v7, Lorg/zeam/CellLayout$CellInfo$VacantCell;->cellY:I

    aput v14, v6, v13

    goto :goto_3

    .line 628
    .end local v7           #cell:Lorg/zeam/CellLayout$CellInfo$VacantCell;
    .end local v9           #distance:D
    :cond_5
    const/4 v13, 0x0

    goto :goto_1
.end method

.method public generateLayoutParams(Landroid/util/AttributeSet;)Landroid/view/ViewGroup$LayoutParams;
    .locals 2
    .parameter "attrs"

    .prologue
    .line 755
    new-instance v0, Lorg/zeam/CellLayout$LayoutParams;

    invoke-virtual {p0}, Lorg/zeam/CellLayout;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1, p1}, Lorg/zeam/CellLayout$LayoutParams;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    return-object v0
.end method

.method protected generateLayoutParams(Landroid/view/ViewGroup$LayoutParams;)Landroid/view/ViewGroup$LayoutParams;
    .locals 1
    .parameter "layoutParams"

    .prologue
    .line 765
    new-instance v0, Lorg/zeam/CellLayout$LayoutParams;

    invoke-direct {v0, p1}, Lorg/zeam/CellLayout$LayoutParams;-><init>(Landroid/view/ViewGroup$LayoutParams;)V

    return-object v0
.end method

.method getCountX()I
    .locals 1

    .prologue
    .line 111
    iget-boolean v0, p0, Lorg/zeam/CellLayout;->mPortrait:Z

    if-eqz v0, :cond_0

    iget v0, p0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    :goto_0
    return v0

    :cond_0
    iget v0, p0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    goto :goto_0
.end method

.method getCountY()I
    .locals 1

    .prologue
    .line 115
    iget-boolean v0, p0, Lorg/zeam/CellLayout;->mPortrait:Z

    if-eqz v0, :cond_0

    iget v0, p0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    :goto_0
    return v0

    :cond_0
    iget v0, p0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    goto :goto_0
.end method

.method getOccupiedCells()[Z
    .locals 9

    .prologue
    .line 710
    iget-boolean v2, p0, Lorg/zeam/CellLayout;->mPortrait:Z

    .line 711
    .local v2, portrait:Z
    if-eqz v2, :cond_0

    iget v7, p0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move v4, v7

    .line 712
    .local v4, xCount:I
    :goto_0
    if-eqz v2, :cond_1

    iget v7, p0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move v6, v7

    .line 713
    .local v6, yCount:I
    :goto_1
    iget-object v1, p0, Lorg/zeam/CellLayout;->mOccupied:[[Z

    .line 715
    .local v1, occupied:[[Z
    const/4 v7, 0x0

    invoke-direct {p0, v4, v6, v1, v7}, Lorg/zeam/CellLayout;->findOccupiedCells(II[[ZLandroid/view/View;)V

    .line 716
    mul-int v7, v4, v6

    new-array v0, v7, [Z

    .line 717
    .local v0, flat:[Z
    const/4 v5, 0x0

    .local v5, y:I
    :goto_2
    if-lt v5, v6, :cond_2

    .line 722
    return-object v0

    .line 711
    .end local v0           #flat:[Z
    .end local v1           #occupied:[[Z
    .end local v4           #xCount:I
    .end local v5           #y:I
    .end local v6           #yCount:I
    :cond_0
    iget v7, p0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move v4, v7

    goto :goto_0

    .line 712
    .restart local v4       #xCount:I
    :cond_1
    iget v7, p0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move v6, v7

    goto :goto_1

    .line 718
    .restart local v0       #flat:[Z
    .restart local v1       #occupied:[[Z
    .restart local v5       #y:I
    .restart local v6       #yCount:I
    :cond_2
    const/4 v3, 0x0

    .local v3, x:I
    :goto_3
    if-lt v3, v4, :cond_3

    .line 717
    add-int/lit8 v5, v5, 0x1

    goto :goto_2

    .line 719
    :cond_3
    mul-int v7, v5, v4

    add-int/2addr v7, v3

    aget-object v8, v1, v3

    aget-boolean v8, v8, v5

    aput-boolean v8, v0, v7

    .line 718
    add-int/lit8 v3, v3, 0x1

    goto :goto_3
.end method

.method public bridge synthetic getTag()Ljava/lang/Object;
    .locals 1

    .prologue
    .line 1
    invoke-virtual {p0}, Lorg/zeam/CellLayout;->getTag()Lorg/zeam/CellLayout$CellInfo;

    move-result-object v0

    return-object v0
.end method

.method public getTag()Lorg/zeam/CellLayout$CellInfo;
    .locals 7

    .prologue
    .line 222
    invoke-super {p0}, Landroid/view/ViewGroup;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lorg/zeam/CellLayout$CellInfo;

    .line 223
    .local v0, info:Lorg/zeam/CellLayout$CellInfo;
    iget-boolean v1, p0, Lorg/zeam/CellLayout;->mDirtyTag:Z

    if-eqz v1, :cond_0

    iget-boolean v1, v0, Lorg/zeam/CellLayout$CellInfo;->valid:Z

    if-eqz v1, :cond_0

    .line 225
    iget-boolean v6, p0, Lorg/zeam/CellLayout;->mPortrait:Z

    .line 226
    .local v6, portrait:Z
    if-eqz v6, :cond_1

    iget v1, p0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move v3, v1

    .line 227
    .local v3, xCount:I
    :goto_0
    if-eqz v6, :cond_2

    iget v1, p0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move v4, v1

    .line 228
    .local v4, yCount:I
    :goto_1
    iget-object v5, p0, Lorg/zeam/CellLayout;->mOccupied:[[Z

    .line 230
    .local v5, occupied:[[Z
    const/4 v1, 0x0

    invoke-direct {p0, v3, v4, v5, v1}, Lorg/zeam/CellLayout;->findOccupiedCells(II[[ZLandroid/view/View;)V

    .line 231
    iget v1, v0, Lorg/zeam/CellLayout$CellInfo;->cellX:I

    iget v2, v0, Lorg/zeam/CellLayout$CellInfo;->cellY:I

    invoke-static/range {v0 .. v5}, Lorg/zeam/CellLayout;->findIntersectingVacantCells(Lorg/zeam/CellLayout$CellInfo;IIII[[Z)V

    .line 232
    const/4 v1, 0x0

    iput-boolean v1, p0, Lorg/zeam/CellLayout;->mDirtyTag:Z

    .line 234
    .end local v3           #xCount:I
    .end local v4           #yCount:I
    .end local v5           #occupied:[[Z
    .end local v6           #portrait:Z
    :cond_0
    return-object v0

    .line 226
    .restart local v6       #portrait:Z
    :cond_1
    iget v1, p0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move v3, v1

    goto :goto_0

    .line 227
    .restart local v3       #xCount:I
    :cond_2
    iget v1, p0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move v4, v1

    goto :goto_1
.end method

.method public getVacantCell([III)Z
    .locals 7
    .parameter "vacant"
    .parameter "spanX"
    .parameter "spanY"

    .prologue
    .line 677
    iget-boolean v6, p0, Lorg/zeam/CellLayout;->mPortrait:Z

    .line 678
    .local v6, portrait:Z
    if-eqz v6, :cond_0

    iget v0, p0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move v3, v0

    .line 679
    .local v3, xCount:I
    :goto_0
    if-eqz v6, :cond_1

    iget v0, p0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move v4, v0

    .line 680
    .local v4, yCount:I
    :goto_1
    iget-object v5, p0, Lorg/zeam/CellLayout;->mOccupied:[[Z

    .line 682
    .local v5, occupied:[[Z
    const/4 v0, 0x0

    invoke-direct {p0, v3, v4, v5, v0}, Lorg/zeam/CellLayout;->findOccupiedCells(II[[ZLandroid/view/View;)V

    move-object v0, p1

    move v1, p2

    move v2, p3

    .line 683
    invoke-static/range {v0 .. v5}, Lorg/zeam/CellLayout;->findVacantCell([IIIII[[Z)Z

    move-result v0

    return v0

    .line 678
    .end local v3           #xCount:I
    .end local v4           #yCount:I
    .end local v5           #occupied:[[Z
    :cond_0
    iget v0, p0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move v3, v0

    goto :goto_0

    .line 679
    .restart local v3       #xCount:I
    :cond_1
    iget v0, p0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move v4, v0

    goto :goto_1
.end method

.method public lastDownOnOccupiedCell()Z
    .locals 1

    .prologue
    .line 750
    iget-boolean v0, p0, Lorg/zeam/CellLayout;->mLastDownOnOccupiedCell:Z

    return v0
.end method

.method protected onAttachedToWindow()V
    .locals 2

    .prologue
    .line 144
    invoke-super {p0}, Landroid/view/ViewGroup;->onAttachedToWindow()V

    .line 145
    iget-object v1, p0, Lorg/zeam/CellLayout;->mCellInfo:Lorg/zeam/CellLayout$CellInfo;

    invoke-virtual {p0}, Lorg/zeam/CellLayout;->getParent()Landroid/view/ViewParent;

    move-result-object v0

    check-cast v0, Landroid/view/ViewGroup;

    invoke-virtual {v0, p0}, Landroid/view/ViewGroup;->indexOfChild(Landroid/view/View;)I

    move-result v0

    iput v0, v1, Lorg/zeam/CellLayout$CellInfo;->screen:I

    .line 146
    return-void
.end method

.method onDragChild(Landroid/view/View;)V
    .locals 2
    .parameter "child"

    .prologue
    .line 657
    invoke-virtual {p1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v0

    check-cast v0, Lorg/zeam/CellLayout$LayoutParams;

    .line 658
    .local v0, layoutParams:Lorg/zeam/CellLayout$LayoutParams;
    const/4 v1, 0x1

    iput-boolean v1, v0, Lorg/zeam/CellLayout$LayoutParams;->isDragging:Z

    .line 659
    iget-object v1, p0, Lorg/zeam/CellLayout;->mDragRect:Landroid/graphics/RectF;

    invoke-virtual {v1}, Landroid/graphics/RectF;->setEmpty()V

    .line 660
    return-void
.end method

.method onDropAborted(Landroid/view/View;)V
    .locals 2
    .parameter "child"

    .prologue
    .line 648
    if-eqz p1, :cond_0

    .line 649
    invoke-virtual {p1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v0

    check-cast v0, Lorg/zeam/CellLayout$LayoutParams;

    const/4 v1, 0x0

    iput-boolean v1, v0, Lorg/zeam/CellLayout$LayoutParams;->isDragging:Z

    .line 650
    invoke-virtual {p0}, Lorg/zeam/CellLayout;->invalidate()V

    .line 652
    :cond_0
    iget-object v0, p0, Lorg/zeam/CellLayout;->mDragRect:Landroid/graphics/RectF;

    invoke-virtual {v0}, Landroid/graphics/RectF;->setEmpty()V

    .line 653
    return-void
.end method

.method onDropChild(Landroid/view/View;[I)V
    .locals 4
    .parameter "child"
    .parameter "targetXY"

    .prologue
    const/4 v3, 0x1

    const/4 v2, 0x0

    .line 634
    if-eqz p1, :cond_0

    .line 635
    invoke-virtual {p1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v0

    check-cast v0, Lorg/zeam/CellLayout$LayoutParams;

    .line 636
    .local v0, layoutParams:Lorg/zeam/CellLayout$LayoutParams;
    aget v1, p2, v2

    iput v1, v0, Lorg/zeam/CellLayout$LayoutParams;->cellX:I

    .line 637
    aget v1, p2, v3

    iput v1, v0, Lorg/zeam/CellLayout$LayoutParams;->cellY:I

    .line 638
    iput-boolean v2, v0, Lorg/zeam/CellLayout$LayoutParams;->isDragging:Z

    .line 639
    iput-boolean v3, v0, Lorg/zeam/CellLayout$LayoutParams;->dropped:Z

    .line 640
    iget-object v1, p0, Lorg/zeam/CellLayout;->mDragRect:Landroid/graphics/RectF;

    invoke-virtual {v1}, Landroid/graphics/RectF;->setEmpty()V

    .line 641
    invoke-virtual {p1}, Landroid/view/View;->requestLayout()V

    .line 642
    invoke-virtual {p0}, Lorg/zeam/CellLayout;->invalidate()V

    .line 644
    .end local v0           #layoutParams:Lorg/zeam/CellLayout$LayoutParams;
    :cond_0
    return-void
.end method

.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 22
    .parameter "motionEvent"

    .prologue
    .line 151
    invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v5

    .line 152
    .local v5, action:I
    move-object/from16 v0, p0

    iget-object v0, v0, Lorg/zeam/CellLayout;->mCellInfo:Lorg/zeam/CellLayout$CellInfo;

    move-object v6, v0

    .line 154
    .local v6, cellInfo:Lorg/zeam/CellLayout$CellInfo;
    if-nez v5, :cond_8

    .line 156
    move-object/from16 v0, p0

    iget-object v0, v0, Lorg/zeam/CellLayout;->mRect:Landroid/graphics/Rect;

    move-object v11, v0

    .line 157
    .local v11, frame:Landroid/graphics/Rect;
    invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getX()F

    move-result v20

    move/from16 v0, v20

    float-to-int v0, v0

    move/from16 v20, v0

    invoke-virtual/range {p0 .. p0}, Lorg/zeam/CellLayout;->getScrollX()I

    move-result v21

    add-int v16, v20, v21

    .line 158
    .local v16, x:I
    invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getY()F

    move-result v20

    move/from16 v0, v20

    float-to-int v0, v0

    move/from16 v20, v0

    invoke-virtual/range {p0 .. p0}, Lorg/zeam/CellLayout;->getScrollY()I

    move-result v21

    add-int v18, v20, v21

    .line 159
    .local v18, y:I
    invoke-virtual/range {p0 .. p0}, Lorg/zeam/CellLayout;->getChildCount()I

    move-result v9

    .line 161
    .local v9, count:I
    const/4 v10, 0x0

    .line 162
    .local v10, found:Z
    const/16 v20, 0x1

    sub-int v12, v9, v20

    .local v12, i:I
    :goto_0
    if-gez v12, :cond_2

    .line 181
    :goto_1
    move v0, v10

    move-object/from16 v1, p0

    iput-boolean v0, v1, Lorg/zeam/CellLayout;->mLastDownOnOccupiedCell:Z

    .line 183
    if-nez v10, :cond_0

    .line 185
    move-object/from16 v0, p0

    iget-object v0, v0, Lorg/zeam/CellLayout;->mCellXY:[I

    move-object v7, v0

    .line 186
    .local v7, cellXY:[I
    move-object/from16 v0, p0

    move/from16 v1, v16

    move/from16 v2, v18

    move-object v3, v7

    invoke-virtual {v0, v1, v2, v3}, Lorg/zeam/CellLayout;->pointToCellExact(II[I)V

    .line 187
    move-object/from16 v0, p0

    iget-boolean v0, v0, Lorg/zeam/CellLayout;->mPortrait:Z

    move v15, v0

    .line 188
    .local v15, portrait:Z
    if-eqz v15, :cond_5

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move/from16 v20, v0

    move/from16 v17, v20

    .line 189
    .local v17, xCount:I
    :goto_2
    if-eqz v15, :cond_6

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move/from16 v20, v0

    move/from16 v19, v20

    .line 190
    .local v19, yCount:I
    :goto_3
    move-object/from16 v0, p0

    iget-object v0, v0, Lorg/zeam/CellLayout;->mOccupied:[[Z

    move-object v14, v0

    .line 192
    .local v14, occupied:[[Z
    const/16 v20, 0x0

    move-object/from16 v0, p0

    move/from16 v1, v17

    move/from16 v2, v19

    move-object v3, v14

    move-object/from16 v4, v20

    invoke-direct {v0, v1, v2, v3, v4}, Lorg/zeam/CellLayout;->findOccupiedCells(II[[ZLandroid/view/View;)V

    .line 194
    const/16 v20, 0x0

    move-object/from16 v0, v20

    move-object v1, v6

    iput-object v0, v1, Lorg/zeam/CellLayout$CellInfo;->cell:Landroid/view/View;

    .line 195
    const/16 v20, 0x0

    aget v20, v7, v20

    move/from16 v0, v20

    move-object v1, v6

    iput v0, v1, Lorg/zeam/CellLayout$CellInfo;->cellX:I

    .line 196
    const/16 v20, 0x1

    aget v20, v7, v20

    move/from16 v0, v20

    move-object v1, v6

    iput v0, v1, Lorg/zeam/CellLayout$CellInfo;->cellY:I

    .line 197
    const/16 v20, 0x1

    move/from16 v0, v20

    move-object v1, v6

    iput v0, v1, Lorg/zeam/CellLayout$CellInfo;->spanX:I

    .line 198
    const/16 v20, 0x1

    move/from16 v0, v20

    move-object v1, v6

    iput v0, v1, Lorg/zeam/CellLayout$CellInfo;->spanY:I

    .line 199
    const/16 v20, 0x0

    aget v20, v7, v20

    if-ltz v20, :cond_7

    const/16 v20, 0x1

    aget v20, v7, v20

    if-ltz v20, :cond_7

    const/16 v20, 0x0

    aget v20, v7, v20

    move/from16 v0, v20

    move/from16 v1, v17

    if-ge v0, v1, :cond_7

    .line 200
    const/16 v20, 0x1

    aget v20, v7, v20

    move/from16 v0, v20

    move/from16 v1, v19

    if-ge v0, v1, :cond_7

    const/16 v20, 0x0

    aget v20, v7, v20

    aget-object v20, v14, v20

    const/16 v21, 0x1

    aget v21, v7, v21

    aget-boolean v20, v20, v21

    if-nez v20, :cond_7

    const/16 v20, 0x1

    .line 199
    :goto_4
    move/from16 v0, v20

    move-object v1, v6

    iput-boolean v0, v1, Lorg/zeam/CellLayout$CellInfo;->valid:Z

    .line 202
    const/16 v20, 0x1

    move/from16 v0, v20

    move-object/from16 v1, p0

    iput-boolean v0, v1, Lorg/zeam/CellLayout;->mDirtyTag:Z

    .line 204
    .end local v7           #cellXY:[I
    .end local v14           #occupied:[[Z
    .end local v15           #portrait:Z
    .end local v17           #xCount:I
    .end local v19           #yCount:I
    :cond_0
    move-object/from16 v0, p0

    move-object v1, v6

    invoke-virtual {v0, v1}, Lorg/zeam/CellLayout;->setTag(Ljava/lang/Object;)V

    .line 216
    .end local v9           #count:I
    .end local v10           #found:Z
    .end local v11           #frame:Landroid/graphics/Rect;
    .end local v12           #i:I
    .end local v16           #x:I
    .end local v18           #y:I
    :cond_1
    :goto_5
    const/16 v20, 0x0

    return v20

    .line 163
    .restart local v9       #count:I
    .restart local v10       #found:Z
    .restart local v11       #frame:Landroid/graphics/Rect;
    .restart local v12       #i:I
    .restart local v16       #x:I
    .restart local v18       #y:I
    :cond_2
    move-object/from16 v0, p0

    move v1, v12

    invoke-virtual {v0, v1}, Lorg/zeam/CellLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v8

    .line 165
    .local v8, child:Landroid/view/View;
    invoke-virtual {v8}, Landroid/view/View;->getVisibility()I

    move-result v20

    if-eqz v20, :cond_3

    invoke-virtual {v8}, Landroid/view/View;->getAnimation()Landroid/view/animation/Animation;

    move-result-object v20

    if-eqz v20, :cond_4

    .line 166
    :cond_3
    invoke-virtual {v8, v11}, Landroid/view/View;->getHitRect(Landroid/graphics/Rect;)V

    .line 167
    move-object v0, v11

    move/from16 v1, v16

    move/from16 v2, v18

    invoke-virtual {v0, v1, v2}, Landroid/graphics/Rect;->contains(II)Z

    move-result v20

    if-eqz v20, :cond_4

    .line 168
    invoke-virtual {v8}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v13

    check-cast v13, Lorg/zeam/CellLayout$LayoutParams;

    .line 169
    .local v13, layoutParams:Lorg/zeam/CellLayout$LayoutParams;
    iput-object v8, v6, Lorg/zeam/CellLayout$CellInfo;->cell:Landroid/view/View;

    .line 170
    move-object v0, v13

    iget v0, v0, Lorg/zeam/CellLayout$LayoutParams;->cellX:I

    move/from16 v20, v0

    move/from16 v0, v20

    move-object v1, v6

    iput v0, v1, Lorg/zeam/CellLayout$CellInfo;->cellX:I

    .line 171
    move-object v0, v13

    iget v0, v0, Lorg/zeam/CellLayout$LayoutParams;->cellY:I

    move/from16 v20, v0

    move/from16 v0, v20

    move-object v1, v6

    iput v0, v1, Lorg/zeam/CellLayout$CellInfo;->cellY:I

    .line 172
    move-object v0, v13

    iget v0, v0, Lorg/zeam/CellLayout$LayoutParams;->cellHSpan:I

    move/from16 v20, v0

    move/from16 v0, v20

    move-object v1, v6

    iput v0, v1, Lorg/zeam/CellLayout$CellInfo;->spanX:I

    .line 173
    move-object v0, v13

    iget v0, v0, Lorg/zeam/CellLayout$LayoutParams;->cellVSpan:I

    move/from16 v20, v0

    move/from16 v0, v20

    move-object v1, v6

    iput v0, v1, Lorg/zeam/CellLayout$CellInfo;->spanY:I

    .line 174
    const/16 v20, 0x1

    move/from16 v0, v20

    move-object v1, v6

    iput-boolean v0, v1, Lorg/zeam/CellLayout$CellInfo;->valid:Z

    .line 175
    const/4 v10, 0x1

    .line 176
    const/16 v20, 0x0

    move/from16 v0, v20

    move-object/from16 v1, p0

    iput-boolean v0, v1, Lorg/zeam/CellLayout;->mDirtyTag:Z

    goto/16 :goto_1

    .line 162
    .end local v13           #layoutParams:Lorg/zeam/CellLayout$LayoutParams;
    :cond_4
    add-int/lit8 v12, v12, -0x1

    goto/16 :goto_0

    .line 188
    .end local v8           #child:Landroid/view/View;
    .restart local v7       #cellXY:[I
    .restart local v15       #portrait:Z
    :cond_5
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move/from16 v20, v0

    move/from16 v17, v20

    goto/16 :goto_2

    .line 189
    .restart local v17       #xCount:I
    :cond_6
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move/from16 v20, v0

    move/from16 v19, v20

    goto/16 :goto_3

    .line 200
    .restart local v14       #occupied:[[Z
    .restart local v19       #yCount:I
    :cond_7
    const/16 v20, 0x0

    goto/16 :goto_4

    .line 206
    .end local v7           #cellXY:[I
    .end local v9           #count:I
    .end local v10           #found:Z
    .end local v11           #frame:Landroid/graphics/Rect;
    .end local v12           #i:I
    .end local v14           #occupied:[[Z
    .end local v15           #portrait:Z
    .end local v16           #x:I
    .end local v17           #xCount:I
    .end local v18           #y:I
    .end local v19           #yCount:I
    :cond_8
    const/16 v20, 0x1

    move v0, v5

    move/from16 v1, v20

    if-ne v0, v1, :cond_1

    .line 207
    const/16 v20, 0x0

    move-object/from16 v0, v20

    move-object v1, v6

    iput-object v0, v1, Lorg/zeam/CellLayout$CellInfo;->cell:Landroid/view/View;

    .line 208
    const/16 v20, -0x1

    move/from16 v0, v20

    move-object v1, v6

    iput v0, v1, Lorg/zeam/CellLayout$CellInfo;->cellX:I

    .line 209
    const/16 v20, -0x1

    move/from16 v0, v20

    move-object v1, v6

    iput v0, v1, Lorg/zeam/CellLayout$CellInfo;->cellY:I

    .line 210
    const/16 v20, 0x0

    move/from16 v0, v20

    move-object v1, v6

    iput v0, v1, Lorg/zeam/CellLayout$CellInfo;->spanX:I

    .line 211
    const/16 v20, 0x0

    move/from16 v0, v20

    move-object v1, v6

    iput v0, v1, Lorg/zeam/CellLayout$CellInfo;->spanY:I

    .line 212
    const/16 v20, 0x0

    move/from16 v0, v20

    move-object v1, v6

    iput-boolean v0, v1, Lorg/zeam/CellLayout$CellInfo;->valid:Z

    .line 213
    const/16 v20, 0x0

    move/from16 v0, v20

    move-object/from16 v1, p0

    iput-boolean v0, v1, Lorg/zeam/CellLayout;->mDirtyTag:Z

    .line 214
    move-object/from16 v0, p0

    move-object v1, v6

    invoke-virtual {v0, v1}, Lorg/zeam/CellLayout;->setTag(Ljava/lang/Object;)V

    goto/16 :goto_5
.end method

.method protected onLayout(ZIIII)V
    .locals 14
    .parameter "changed"
    .parameter "l"
    .parameter "t"
    .parameter "r"
    .parameter "b"

    .prologue
    .line 555
    invoke-virtual {p0}, Lorg/zeam/CellLayout;->getChildCount()I

    move-result v11

    .line 556
    .local v11, count:I
    const/4 v12, 0x0

    .local v12, i:I
    :goto_0
    if-lt v12, v11, :cond_0

    .line 577
    return-void

    .line 557
    :cond_0
    invoke-virtual {p0, v12}, Lorg/zeam/CellLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v8

    .line 558
    .local v8, child:Landroid/view/View;
    invoke-virtual {v8}, Landroid/view/View;->getVisibility()I

    move-result v0

    const/16 v1, 0x8

    if-eq v0, v1, :cond_1

    .line 560
    invoke-virtual {v8}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v13

    check-cast v13, Lorg/zeam/CellLayout$LayoutParams;

    .line 561
    .local v13, layoutParams:Lorg/zeam/CellLayout$LayoutParams;
    iget v9, v13, Lorg/zeam/CellLayout$LayoutParams;->x:I

    .line 562
    .local v9, childLeft:I
    iget v10, v13, Lorg/zeam/CellLayout$LayoutParams;->y:I

    .line 564
    .local v10, childTop:I
    iget v0, v13, Lorg/zeam/CellLayout$LayoutParams;->width:I

    add-int/2addr v0, v9

    iget v1, v13, Lorg/zeam/CellLayout$LayoutParams;->height:I

    add-int/2addr v1, v10

    invoke-virtual {v8, v9, v10, v0, v1}, Landroid/view/View;->layout(IIII)V

    .line 565
    iget-boolean v0, v13, Lorg/zeam/CellLayout$LayoutParams;->dropped:Z

    if-eqz v0, :cond_1

    .line 567
    const/4 v0, 0x0

    iput-boolean v0, v13, Lorg/zeam/CellLayout$LayoutParams;->dropped:Z

    .line 568
    iget-object v7, p0, Lorg/zeam/CellLayout;->mCellXY:[I

    .line 569
    .local v7, cellXY:[I
    invoke-virtual {p0, v7}, Lorg/zeam/CellLayout;->getLocationOnScreen([I)V

    .line 570
    iget-object v0, p0, Lorg/zeam/CellLayout;->mWallpaperManager:Landroid/app/WallpaperManager;

    invoke-virtual {p0}, Lorg/zeam/CellLayout;->getWindowToken()Landroid/os/IBinder;

    move-result-object v1

    .line 571
    const-string v2, "android.home.drop"

    const/4 v3, 0x0

    aget v3, v7, v3

    add-int/2addr v3, v9

    iget v4, v13, Lorg/zeam/CellLayout$LayoutParams;->width:I

    div-int/lit8 v4, v4, 0x2

    add-int/2addr v3, v4

    .line 572
    const/4 v4, 0x1

    aget v4, v7, v4

    add-int/2addr v4, v10

    iget v5, v13, Lorg/zeam/CellLayout$LayoutParams;->height:I

    div-int/lit8 v5, v5, 0x2

    add-int/2addr v4, v5

    const/4 v5, 0x0

    const/4 v6, 0x0

    .line 570
    invoke-virtual/range {v0 .. v6}, Landroid/app/WallpaperManager;->sendWallpaperCommand(Landroid/os/IBinder;Ljava/lang/String;IIILandroid/os/Bundle;)V

    .line 556
    .end local v7           #cellXY:[I
    .end local v9           #childLeft:I
    .end local v10           #childTop:I
    .end local v13           #layoutParams:Lorg/zeam/CellLayout$LayoutParams;
    :cond_1
    add-int/lit8 v12, v12, 0x1

    goto :goto_0
.end method

.method protected onMeasure(II)V
    .locals 38
    .parameter "widthMeasureSpec"
    .parameter "heightMeasureSpec"

    .prologue
    .line 442
    invoke-virtual/range {p0 .. p0}, Lorg/zeam/CellLayout;->getContext()Landroid/content/Context;

    move-result-object v6

    invoke-static {v6}, Lorg/zeam/PreferencesUtil;->isAutoFitContentGridItemsEnabled(Landroid/content/Context;)Z

    move-result v10

    .line 444
    .local v10, autoFit:Z
    invoke-static/range {p1 .. p1}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v36

    .line 445
    .local v36, widthSpecMode:I
    invoke-static/range {p1 .. p1}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v37

    .line 446
    .local v37, widthSpecSize:I
    invoke-static/range {p2 .. p2}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v24

    .line 447
    .local v24, heightSpecMode:I
    invoke-static/range {p2 .. p2}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v25

    .line 449
    .local v25, heightSpecSize:I
    if-eqz v36, :cond_0

    if-nez v24, :cond_1

    .line 450
    :cond_0
    new-instance v6, Ljava/lang/RuntimeException;

    const-string v7, "CellLayout cannot have UNSPECIFIED dimensions"

    invoke-direct {v6, v7}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V

    throw v6

    .line 453
    :cond_1
    move/from16 v0, v25

    move/from16 v1, v37

    if-le v0, v1, :cond_4

    const/4 v6, 0x1

    :goto_0
    move v0, v6

    move-object/from16 v1, p0

    iput-boolean v0, v1, Lorg/zeam/CellLayout;->mPortrait:Z

    .line 454
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mCellWidth:I

    move/from16 v34, v0

    .line 455
    .local v34, tmpCellW:I
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mCellHeight:I

    move/from16 v33, v0

    .line 457
    .local v33, tmpCellH:I
    move-object/from16 v0, p0

    iget-boolean v0, v0, Lorg/zeam/CellLayout;->mPortrait:Z

    move v6, v0

    if-eqz v6, :cond_5

    .line 459
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mRows:I

    move v6, v0

    move v0, v6

    move-object/from16 v1, p0

    iput v0, v1, Lorg/zeam/CellLayout;->mLongAxisCells:I

    .line 460
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mColumns:I

    move v6, v0

    move v0, v6

    move-object/from16 v1, p0

    iput v0, v1, Lorg/zeam/CellLayout;->mShortAxisCells:I

    .line 461
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mShortAxisStartPadding:I

    move v6, v0

    sub-int v6, v37, v6

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mShortAxisEndPadding:I

    move v7, v0

    sub-int/2addr v6, v7

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mColumns:I

    move v7, v0

    div-int v34, v6, v7

    .line 462
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mLongAxisStartPadding:I

    move v6, v0

    sub-int v6, v25, v6

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mLongAxisEndPadding:I

    move v7, v0

    sub-int/2addr v6, v7

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mRows:I

    move v7, v0

    div-int v33, v6, v7

    .line 469
    :goto_1
    if-eqz v10, :cond_2

    .line 470
    move/from16 v0, v34

    move-object/from16 v1, p0

    iput v0, v1, Lorg/zeam/CellLayout;->mCellWidth:I

    .line 471
    move/from16 v0, v33

    move-object/from16 v1, p0

    iput v0, v1, Lorg/zeam/CellLayout;->mCellHeight:I

    .line 473
    :cond_2
    move-object/from16 v0, p0

    iget-object v0, v0, Lorg/zeam/CellLayout;->mOccupied:[[Z

    move-object v6, v0

    if-nez v6, :cond_3

    .line 474
    move-object/from16 v0, p0

    iget-boolean v0, v0, Lorg/zeam/CellLayout;->mPortrait:Z

    move v6, v0

    if-eqz v6, :cond_6

    .line 475
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move v6, v0

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move v7, v0

    filled-new-array {v6, v7}, [I

    move-result-object v6

    sget-object v7, Ljava/lang/Boolean;->TYPE:Ljava/lang/Class;

    invoke-static {v7, v6}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;[I)Ljava/lang/Object;

    move-result-object p1

    .end local p1
    check-cast p1, [[Z

    move-object/from16 v0, p1

    move-object/from16 v1, p0

    iput-object v0, v1, Lorg/zeam/CellLayout;->mOccupied:[[Z

    .line 480
    :cond_3
    :goto_2
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move/from16 v31, v0

    .line 481
    .local v31, shortAxisCells:I
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move/from16 v27, v0

    .line 482
    .local v27, longAxisCells:I
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mLongAxisStartPadding:I

    move v9, v0

    .line 483
    .local v9, longAxisStartPadding:I
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mLongAxisEndPadding:I

    move/from16 v28, v0

    .line 484
    .local v28, longAxisEndPadding:I
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mShortAxisStartPadding:I

    move v8, v0

    .line 485
    .local v8, shortAxisStartPadding:I
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mShortAxisEndPadding:I

    move/from16 v32, v0

    .line 486
    .local v32, shortAxisEndPadding:I
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mCellWidth:I

    move v4, v0

    .line 487
    .local v4, cellWidth:I
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mCellHeight:I

    move v5, v0

    .line 489
    .local v5, cellHeight:I
    move/from16 v0, v25

    move/from16 v1, v37

    if-le v0, v1, :cond_7

    const/4 v6, 0x1

    :goto_3
    move v0, v6

    move-object/from16 v1, p0

    iput-boolean v0, v1, Lorg/zeam/CellLayout;->mPortrait:Z

    .line 491
    const/4 v6, 0x1

    sub-int v30, v31, v6

    .line 492
    .local v30, numShortGaps:I
    const/4 v6, 0x1

    sub-int v29, v27, v6

    .line 494
    .local v29, numLongGaps:I
    move-object/from16 v0, p0

    iget-boolean v0, v0, Lorg/zeam/CellLayout;->mPortrait:Z

    move v6, v0

    if-eqz v6, :cond_9

    .line 496
    sub-int v6, v25, v9

    sub-int v6, v6, v28

    .line 497
    mul-int v7, v5, v27

    .line 496
    sub-int v35, v6, v7

    .line 499
    .local v35, vSpaceLeft:I
    div-int v6, v35, v29

    move v0, v6

    move-object/from16 v1, p0

    iput v0, v1, Lorg/zeam/CellLayout;->mHeightGap:I

    .line 501
    sub-int v6, v37, v8

    sub-int v6, v6, v32

    .line 502
    mul-int v7, v4, v31

    .line 501
    sub-int v23, v6, v7

    .line 504
    .local v23, hSpaceLeft:I
    if-lez v30, :cond_8

    .line 505
    div-int v6, v23, v30

    move v0, v6

    move-object/from16 v1, p0

    iput v0, v1, Lorg/zeam/CellLayout;->mWidthGap:I

    .line 525
    :goto_4
    invoke-virtual/range {p0 .. p0}, Lorg/zeam/CellLayout;->getChildCount()I

    move-result v22

    .line 527
    .local v22, count:I
    const/16 v26, 0x0

    .local v26, i:I
    :goto_5
    move/from16 v0, v26

    move/from16 v1, v22

    if-lt v0, v1, :cond_b

    .line 549
    move-object/from16 v0, p0

    move/from16 v1, v37

    move/from16 v2, v25

    invoke-virtual {v0, v1, v2}, Lorg/zeam/CellLayout;->setMeasuredDimension(II)V

    .line 550
    return-void

    .line 453
    .end local v4           #cellWidth:I
    .end local v5           #cellHeight:I
    .end local v8           #shortAxisStartPadding:I
    .end local v9           #longAxisStartPadding:I
    .end local v22           #count:I
    .end local v23           #hSpaceLeft:I
    .end local v26           #i:I
    .end local v27           #longAxisCells:I
    .end local v28           #longAxisEndPadding:I
    .end local v29           #numLongGaps:I
    .end local v30           #numShortGaps:I
    .end local v31           #shortAxisCells:I
    .end local v32           #shortAxisEndPadding:I
    .end local v33           #tmpCellH:I
    .end local v34           #tmpCellW:I
    .end local v35           #vSpaceLeft:I
    .restart local p1
    :cond_4
    const/4 v6, 0x0

    goto/16 :goto_0

    .line 464
    .restart local v33       #tmpCellH:I
    .restart local v34       #tmpCellW:I
    :cond_5
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mRows:I

    move v6, v0

    move v0, v6

    move-object/from16 v1, p0

    iput v0, v1, Lorg/zeam/CellLayout;->mShortAxisCells:I

    .line 465
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mColumns:I

    move v6, v0

    move v0, v6

    move-object/from16 v1, p0

    iput v0, v1, Lorg/zeam/CellLayout;->mLongAxisCells:I

    .line 466
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mLongAxisStartPadding:I

    move v6, v0

    sub-int v6, v37, v6

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mLongAxisEndPadding:I

    move v7, v0

    sub-int/2addr v6, v7

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mColumns:I

    move v7, v0

    div-int v34, v6, v7

    .line 467
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mShortAxisStartPadding:I

    move v6, v0

    sub-int v6, v25, v6

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mShortAxisEndPadding:I

    move v7, v0

    sub-int/2addr v6, v7

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mRows:I

    move v7, v0

    div-int v33, v6, v7

    goto/16 :goto_1

    .line 477
    :cond_6
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move v6, v0

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move v7, v0

    filled-new-array {v6, v7}, [I

    move-result-object v6

    sget-object v7, Ljava/lang/Boolean;->TYPE:Ljava/lang/Class;

    invoke-static {v7, v6}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;[I)Ljava/lang/Object;

    move-result-object p1

    .end local p1
    check-cast p1, [[Z

    move-object/from16 v0, p1

    move-object/from16 v1, p0

    iput-object v0, v1, Lorg/zeam/CellLayout;->mOccupied:[[Z

    goto/16 :goto_2

    .line 489
    .restart local v4       #cellWidth:I
    .restart local v5       #cellHeight:I
    .restart local v8       #shortAxisStartPadding:I
    .restart local v9       #longAxisStartPadding:I
    .restart local v27       #longAxisCells:I
    .restart local v28       #longAxisEndPadding:I
    .restart local v31       #shortAxisCells:I
    .restart local v32       #shortAxisEndPadding:I
    :cond_7
    const/4 v6, 0x0

    goto/16 :goto_3

    .line 507
    .restart local v23       #hSpaceLeft:I
    .restart local v29       #numLongGaps:I
    .restart local v30       #numShortGaps:I
    .restart local v35       #vSpaceLeft:I
    :cond_8
    const/4 v6, 0x0

    move v0, v6

    move-object/from16 v1, p0

    iput v0, v1, Lorg/zeam/CellLayout;->mWidthGap:I

    goto :goto_4

    .line 510
    .end local v23           #hSpaceLeft:I
    .end local v35           #vSpaceLeft:I
    :cond_9
    sub-int v6, v37, v9

    sub-int v6, v6, v28

    .line 511
    mul-int v7, v4, v27

    .line 510
    sub-int v23, v6, v7

    .line 513
    .restart local v23       #hSpaceLeft:I
    div-int v6, v23, v29

    move v0, v6

    move-object/from16 v1, p0

    iput v0, v1, Lorg/zeam/CellLayout;->mWidthGap:I

    .line 515
    sub-int v6, v25, v8

    sub-int v6, v6, v32

    .line 516
    mul-int v7, v5, v31

    .line 515
    sub-int v35, v6, v7

    .line 518
    .restart local v35       #vSpaceLeft:I
    if-lez v30, :cond_a

    .line 519
    div-int v6, v35, v30

    move v0, v6

    move-object/from16 v1, p0

    iput v0, v1, Lorg/zeam/CellLayout;->mHeightGap:I

    goto/16 :goto_4

    .line 521
    :cond_a
    const/4 v6, 0x0

    move v0, v6

    move-object/from16 v1, p0

    iput v0, v1, Lorg/zeam/CellLayout;->mHeightGap:I

    goto/16 :goto_4

    .line 529
    .restart local v22       #count:I
    .restart local v26       #i:I
    :cond_b
    move-object/from16 v0, p0

    move/from16 v1, v26

    invoke-virtual {v0, v1}, Lorg/zeam/CellLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v19

    .line 530
    .local v19, child:Landroid/view/View;
    invoke-virtual/range {v19 .. v19}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v3

    check-cast v3, Lorg/zeam/CellLayout$LayoutParams;

    .line 531
    .local v3, layoutParams:Lorg/zeam/CellLayout$LayoutParams;
    move-object/from16 v0, p0

    iget-boolean v0, v0, Lorg/zeam/CellLayout;->mPortrait:Z

    move v6, v0

    if-eqz v6, :cond_d

    .line 532
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mWidthGap:I

    move v6, v0

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mHeightGap:I

    move v7, v0

    invoke-virtual/range {v3 .. v10}, Lorg/zeam/CellLayout$LayoutParams;->setup(IIIIIIZ)V

    .line 539
    :goto_6
    iget-boolean v6, v3, Lorg/zeam/CellLayout$LayoutParams;->regenerateId:Z

    if-eqz v6, :cond_c

    .line 540
    invoke-virtual/range {p0 .. p0}, Lorg/zeam/CellLayout;->getId()I

    move-result v6

    and-int/lit16 v6, v6, 0xff

    shl-int/lit8 v6, v6, 0x10

    iget v7, v3, Lorg/zeam/CellLayout$LayoutParams;->cellX:I

    and-int/lit16 v7, v7, 0xff

    shl-int/lit8 v7, v7, 0x8

    or-int/2addr v6, v7

    iget v7, v3, Lorg/zeam/CellLayout$LayoutParams;->cellY:I

    and-int/lit16 v7, v7, 0xff

    or-int/2addr v6, v7

    move-object/from16 v0, v19

    move v1, v6

    invoke-virtual {v0, v1}, Landroid/view/View;->setId(I)V

    .line 541
    const/4 v6, 0x0

    iput-boolean v6, v3, Lorg/zeam/CellLayout$LayoutParams;->regenerateId:Z

    .line 544
    :cond_c
    iget v6, v3, Lorg/zeam/CellLayout$LayoutParams;->width:I

    const/high16 v7, 0x4000

    invoke-static {v6, v7}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v20

    .line 545
    .local v20, childWidthMeasureSpec:I
    iget v6, v3, Lorg/zeam/CellLayout$LayoutParams;->height:I

    const/high16 v7, 0x4000

    invoke-static {v6, v7}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I

    move-result v21

    .line 546
    .local v21, childheightMeasureSpec:I
    invoke-virtual/range {v19 .. v21}, Landroid/view/View;->measure(II)V

    .line 527
    add-int/lit8 v26, v26, 0x1

    goto/16 :goto_5

    .line 535
    .end local v20           #childWidthMeasureSpec:I
    .end local v21           #childheightMeasureSpec:I
    :cond_d
    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mWidthGap:I

    move v14, v0

    move-object/from16 v0, p0

    iget v0, v0, Lorg/zeam/CellLayout;->mHeightGap:I

    move v15, v0

    move-object v11, v3

    move v12, v4

    move v13, v5

    move/from16 v16, v9

    move/from16 v17, v8

    move/from16 v18, v10

    invoke-virtual/range {v11 .. v18}, Lorg/zeam/CellLayout$LayoutParams;->setup(IIIIIIZ)V

    goto :goto_6
.end method

.method pointToCellExact(II[I)V
    .locals 10
    .parameter "x"
    .parameter "y"
    .parameter "result"

    .prologue
    const/4 v9, 0x1

    const/4 v8, 0x0

    .line 406
    iget-boolean v1, p0, Lorg/zeam/CellLayout;->mPortrait:Z

    .line 407
    .local v1, portrait:Z
    if-eqz v1, :cond_4

    iget v5, p0, Lorg/zeam/CellLayout;->mShortAxisStartPadding:I

    move v0, v5

    .line 408
    .local v0, hStartPadding:I
    :goto_0
    if-eqz v1, :cond_5

    iget v5, p0, Lorg/zeam/CellLayout;->mLongAxisStartPadding:I

    move v2, v5

    .line 410
    .local v2, vStartPadding:I
    :goto_1
    sub-int v5, p1, v0

    iget v6, p0, Lorg/zeam/CellLayout;->mCellWidth:I

    iget v7, p0, Lorg/zeam/CellLayout;->mWidthGap:I

    add-int/2addr v6, v7

    div-int/2addr v5, v6

    aput v5, p3, v8

    .line 411
    sub-int v5, p2, v2

    iget v6, p0, Lorg/zeam/CellLayout;->mCellHeight:I

    iget v7, p0, Lorg/zeam/CellLayout;->mHeightGap:I

    add-int/2addr v6, v7

    div-int/2addr v5, v6

    aput v5, p3, v9

    .line 413
    if-eqz v1, :cond_6

    iget v5, p0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move v3, v5

    .line 414
    .local v3, xAxis:I
    :goto_2
    if-eqz v1, :cond_7

    iget v5, p0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move v4, v5

    .line 416
    .local v4, yAxis:I
    :goto_3
    aget v5, p3, v8

    if-gez v5, :cond_0

    .line 417
    aput v8, p3, v8

    .line 419
    :cond_0
    aget v5, p3, v8

    if-lt v5, v3, :cond_1

    .line 420
    sub-int v5, v3, v9

    aput v5, p3, v8

    .line 422
    :cond_1
    aget v5, p3, v9

    if-gez v5, :cond_2

    .line 423
    aput v8, p3, v9

    .line 425
    :cond_2
    aget v5, p3, v9

    if-lt v5, v4, :cond_3

    .line 426
    sub-int v5, v4, v9

    aput v5, p3, v9

    .line 428
    :cond_3
    return-void

    .line 407
    .end local v0           #hStartPadding:I
    .end local v2           #vStartPadding:I
    .end local v3           #xAxis:I
    .end local v4           #yAxis:I
    :cond_4
    iget v5, p0, Lorg/zeam/CellLayout;->mLongAxisStartPadding:I

    move v0, v5

    goto :goto_0

    .line 408
    .restart local v0       #hStartPadding:I
    :cond_5
    iget v5, p0, Lorg/zeam/CellLayout;->mShortAxisStartPadding:I

    move v2, v5

    goto :goto_1

    .line 413
    .restart local v2       #vStartPadding:I
    :cond_6
    iget v5, p0, Lorg/zeam/CellLayout;->mLongAxisCells:I

    move v3, v5

    goto :goto_2

    .line 414
    .restart local v3       #xAxis:I
    :cond_7
    iget v5, p0, Lorg/zeam/CellLayout;->mShortAxisCells:I

    move v4, v5

    goto :goto_3
.end method

.method public rectToCell(II)[I
    .locals 8
    .parameter "width"
    .parameter "height"

    .prologue
    .line 664
    invoke-virtual {p0}, Lorg/zeam/CellLayout;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    .line 665
    .local v2, resources:Landroid/content/res/Resources;
    const v6, 0x7f080003

    invoke-virtual {v2, v6}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result v1

    .line 666
    .local v1, actualWidth:I
    const v6, 0x7f080004

    invoke-virtual {v2, v6}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result v0

    .line 668
    .local v0, actualHeight:I
    invoke-static {v1, v0}, Ljava/lang/Math;->min(II)I

    move-result v3

    .line 669
    .local v3, smallerSize:I
    add-int v6, p1, v3

    div-int v4, v6, v3

    .line 670
    .local v4, spanX:I
    add-int v6, p2, v3

    div-int v5, v6, v3

    .line 672
    .local v5, spanY:I
    const/4 v6, 0x2

    new-array v6, v6, [I

    const/4 v7, 0x0

    aput v4, v6, v7

    const/4 v7, 0x1

    aput v5, v6, v7

    return-object v6
.end method

.method public requestChildFocus(Landroid/view/View;Landroid/view/View;)V
    .locals 1
    .parameter "child"
    .parameter "focused"

    .prologue
    .line 134
    invoke-super {p0, p1, p2}, Landroid/view/ViewGroup;->requestChildFocus(Landroid/view/View;Landroid/view/View;)V

    .line 135
    if-eqz p1, :cond_0

    .line 136
    new-instance v0, Landroid/graphics/Rect;

    invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V

    .line 137
    .local v0, rect:Landroid/graphics/Rect;
    invoke-virtual {p1, v0}, Landroid/view/View;->getDrawingRect(Landroid/graphics/Rect;)V

    .line 138
    invoke-virtual {p0, v0}, Lorg/zeam/CellLayout;->requestRectangleOnScreen(Landroid/graphics/Rect;)Z

    .line 140
    .end local v0           #rect:Landroid/graphics/Rect;
    :cond_0
    return-void
.end method

.method protected setChildrenDrawingCacheEnabled(Z)V
    .locals 4
    .parameter "enabled"

    .prologue
    .line 582
    invoke-virtual {p0}, Lorg/zeam/CellLayout;->getChildCount()I

    move-result v0

    .line 583
    .local v0, count:I
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    if-lt v1, v0, :cond_0

    .line 588
    return-void

    .line 584
    :cond_0
    invoke-virtual {p0, v1}, Lorg/zeam/CellLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    .line 585
    .local v2, view:Landroid/view/View;
    invoke-virtual {v2, p1}, Landroid/view/View;->setDrawingCacheEnabled(Z)V

    .line 586
    const/4 v3, 0x1

    invoke-virtual {v2, v3}, Landroid/view/View;->buildDrawingCache(Z)V

    .line 583
    add-int/lit8 v1, v1, 0x1

    goto :goto_0
.end method

.method protected setChildrenDrawnWithCacheEnabled(Z)V
    .locals 0
    .parameter "enabled"

    .prologue
    .line 592
    invoke-super {p0, p1}, Landroid/view/ViewGroup;->setChildrenDrawnWithCacheEnabled(Z)V

    .line 593
    return-void
.end method
